<ng-container *ngIf="tagData.name==='newStyle'; else elseNormalTemplate">
  <div class="tagBox" [ngStyle]="tagData.cssStyle | styleFilter">
    <div class="newStyleMainBox" *ngFor="let it of tagData.data.data; ">
      <div class="singleRowBox">
        <div class="singleRowTitle">{{it.label}} </div>
        <div class="singleItemBox">
          <div class="subDataBox" *ngFor="let tag of it?.children ,let a = index" appDebounceClick
            (debounceClick)="tagClick(tag)">
            <img class="subDataImgBox" src="{{tag.img}}" alt="" onerror="this.src='assets/img/default_img.png'">
            <p class="subDataLabel">{{tag.label}}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</ng-container>
<ng-template #elseNormalTemplate>
  <!--2024.03.28-->
  <ng-container *ngIf="tagData.name==='supermarketProducts'; else elseNormalClassTemplate">
    <div class="multiple-select-bg-3 supermarketProducts" [ngStyle]="tagData.cssStyle | styleFilter">
      <!-- 商品分类 -->
      <div class="multiple-select-left supermarketProducts">
        <div class="item-left" [ngClass]="{'item-left-open': it.open}" *ngFor="let it of tagData.classData; "
          appDebounceClick (debounceClick)="itemLeftClick(it,1)">
          <span class="yellow-current" *ngIf="it.open"></span>
          <span class="red-dot" *ngIf="it.hasValue"></span>
          {{it.label}}<img class="type-icon" *ngIf="it.icon && it.icon.length > 1" src="{{it.icon}}" />
        </div>
      </div>
      <!-- 商品分类对应的商品列表 -->
      <div class="multiple-select-right supermarketProductsMinHeight">
        <ion-content class="supermarketProductsMinHeight">
          <!--2024.04.13支持分页-->
          <!-- <section> -->
          <div class="row-bg">
            <div class="tag-supermarket-bg">

              <ng-container *ngIf="tagData.listData.length>0; else elseListDataEmptyTemplate">
                <div class="right-img-bg" *ngFor="let tag of tagData?.listData ,let a = index">
                  <img class="tag-supermarket-img" src="{{tag.img}}" alt=""
                    onerror="this.src='assets/img/default_img.png'" appDebounceClick
                    (debounceClick)="gotoDetail($event,tag.link)" [ngStyle]="tag?.imgCssStyle|styleFilter">
                  <div class="right-title-box">
                    <p class="supermarket-label" [ngStyle]="tag?.labelCssStyle|styleFilter">{{tag.label}}</p>

                    <div class="supermarket-inner-box" [ngStyle]="tag?.innerBox1CssStyle|styleFilter">
                      <font class="makert-amount-unit" [ngStyle]="tag?.amountUnitCssStyle|styleFilter">￥</font>
                      <font class="makert-amount" [ngStyle]="tag?.amountCssStyle|styleFilter">
                        {{(getInterger(tag.price - 0) | currency:'CNY':'':'1.0-0')}}</font>
                      <i class="market-amount-digits">{{(tag.price - 0 | currency:'CNY':'':'0.2-2')+''|slice:-3}}</i>
                    </div>

                    <div class="supermarket-money-box" [ngStyle]="tag?.moneyBoxCssStyle|styleFilter">
                      <div class="supermarket-inner-box" [ngStyle]="tag?.innerBox2CssStyle|styleFilter">
                        <font class="makert-amount-unit" [ngStyle]="tag?.goodsCurPriceUnitCssStyle|styleFilter">
                          {{tag?.goodsCurPriceUnit}}</font>
                        <font class="makert-amount" [ngStyle]="tag?.goodsCurPriceCssStyle|styleFilter">
                          {{(getInterger(tag.goodsCurPrice - 0) | currency:'CNY':'':'1.0-0')}}</font>
                        <i class="market-amount-digits"
                          [ngStyle]="tag?.goodsCurPriceDigitCssStyle|styleFilter">{{(tag.goodsCurPrice - 0 |
                          currency:'CNY':'':'0.2-2')+''|slice:-3}}</i>
                        <span class="marketPriceLabel" *ngIf="tag?.goodsCurPriceLabel"
                          [ngStyle]="tag?.goodsCurPriceLabelCssStyle|styleFilter">{{tag?.goodsCurPriceLabel}}</span>
                      </div>

                      <!--加入购物车按钮-->
                      <div class="cartBox" [ngStyle]="tag?.cartBoxCssStyle|styleFilter" appDebounceClick
                        (debounceClick)="addToCart(tag)">

                        <div class="addTips" *ngIf="tag?.addTips" [ngStyle]="tag?.addTipsCssStyle|styleFilter">
                          {{tag.addTips}}</div>

                        <ng-container *ngIf="tag.buyCount&&tag.buyCount!=='0'">
                          <ng-container *ngIf="getInterger(tag.buyCount) <= 9; else elseBigThanNightTemplate">
                            <ion-badge class="badge2" [ngStyle]="tag?.buyCountCssStyle|styleFilter">
                              {{tag?.buyCount}}</ion-badge>
                          </ng-container>
                          <ng-template #elseBigThanNightTemplate>
                            <ion-badge class="badge" [ngStyle]="tag?.buyCountCssStyle|styleFilter">
                              {{tag?.buyCount}}</ion-badge>
                          </ng-template>
                        </ng-container>



                        <img class="tag-supermarket-add-img"
                          src="https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_1711676255490b4514b48116ebca8f771c3def56438df.png"
                          alt=""
                          onerror="this.src='https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_1711676255490b4514b48116ebca8f771c3def56438df.png'">

                      </div>


                    </div>
                  </div>
                </div>
              </ng-container>
              <!--没有商品订单信息-->
              <ng-template #elseListDataEmptyTemplate>

                <div class="right-img-bg">
                  <div class="emptyListData">暂无商品信息</div>
                </div>
              </ng-template>
            </div>
          </div>
          <ion-infinite-scroll threshold="100px" (ionInfinite)="loadData($event)">
            <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="正在加载更多数据...">
            </ion-infinite-scroll-content>
          </ion-infinite-scroll>
          <!-- </section> -->
        </ion-content>
      </div>
    </div>
  </ng-container>
  <ng-template #elseNormalClassTemplate>
    <div class="multiple-select-bg-3" [ngStyle]="tagData.cssStyle | styleFilter">
      <div class="multiple-select-left">
        <div class="item-left" [ngClass]="{'item-left-open': it.open}" *ngFor="let it of tagData.data.data; "
          appDebounceClick (debounceClick)="itemLeftClick(it)">
          <span class="yellow-current" *ngIf="it.open"></span>
          <span class="red-dot" *ngIf="it.hasValue"></span>
          {{it.label}}<img class="type-icon" *ngIf="it.icon && it.icon.length > 1" src="{{it.icon}}" />
        </div>
      </div>
      <div class="multiple-select-right">
        <ng-container
          *ngIf="tagData.current?.children.length > 0 && tagData.current?.children[0].children.length === 0; else hasChildren">

          <div class="row-bg">
            <div class="tag-bg">
              <ng-container
                *ngIf="tagData.current.children[0].img && tagData.current.children[0].img.length > 0; else tagNoImg">
                <div class="tag-img-bg" appDebounceClick (debounceClick)="tagClick(tag)"
                  *ngFor="let tag of tagData.current?.children ,let a = index">
                  <img class="tag-img" src="{{tag.img}}" alt="">
                  <p class="tag-label">{{tag.label}}</p>
                </div>
              </ng-container>
              <ng-template #tagNoImg>
                <div class="tag" [ngClass]="{'tag-mr075': a%2 === 0}" appDebounceClick (debounceClick)="tagClick(tag)"
                  *ngFor="let tag of tagData.current?.children ,let a = index">{{tag.label}}
                </div>
              </ng-template>


            </div>

          </div>
        </ng-container>
        <ng-template #hasChildren>
          <div class="row-bg" *ngFor="let it of tagData.current?.children, let i = index">

            <div class="row" [ngClass]="{'not-first-row': i !== 0}">

              <span style="flex-grow: 1;">{{it.label}}</span>
            </div>
            <div class="tag-bg" id=it.value *ngIf="it.children && it.children.length >0">

              <ng-container *ngIf="it.children[0].img && it.children[0].img.length > 0; else tagNoImg">
                <div class="tag-img-bg" appDebounceClick (debounceClick)="tagClick(tag)"
                  *ngFor="let tag of it.children ,let a = index">
                  <img class="tag-img" src="{{tag.img}}" alt="">
                  <p class="tag-label">{{tag.label}}</p>
                </div>
              </ng-container>
              <ng-template #tagNoImg>
                <div class="tag" [ngClass]="{'tag-mr075': a%2 === 0}" appDebounceClick (debounceClick)="tagClick(tag)"
                  *ngFor="let tag of it.children, let a = index">{{tag.label}}
                </div>
              </ng-template>





            </div>

          </div>
        </ng-template>
      </div>
    </div>
  </ng-template>

















</ng-template>